Repository navigation
Conversation
…Source AncestorType bindings (#36905) > [!NOTE] > Are you waiting for the changes in this PR to be merged? > It would be very helpful if you could [test the resulting artifacts](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from this PR and let us know in a comment if this change resolves your issue. Thank you! ### Root Cause The issue occurs because of a change that taught the XAML source generator to compile RelativeSource AncestorType bindings at build time instead of always relying on reflection. This introduced a build warning (MAUIG2045) whenever a bound property could not be found on the declared AncestorType . This check is unsound because AncestorType matching in XAML is polymorphic: at runtime, the framework walks up the visual tree and accepts any ancestor whose type matches the declared type or a subclass of it. A property missing on the declared type (e.g., ContentPage ) may still be legitimately supplied by a derived class used at runtime (e.g., BasePage : ContentPage declaring SelectedItem ). Since the generator checked only the declared type, it produced false positive warnings that broke builds using TreatWarningsAsErrors=true . ### Description of Change The fix narrows the diagnostic condition so MAUIG2045 fires only when the declared AncestorType is sealed . A sealed type has no subclasses, so a missing property there provably breaks the binding. For non-sealed types, the compiler cannot rule out a derived ancestor supplying the property, so the diagnostic is suppressed and the binding falls back to reflection at runtime, the same safe fallback already used for x:Reference bindings. This is a minimal, one-line change to the diagnostic condition. It was validated with a regression test reproducing the exact scenario (an unsealed base page whose subclass supplies the bound property), confirming the test fails without the fix and passes with it, while the rest of the test suite is unaffected. ### Regression PR PR #34408 Tested the behavior in the following platforms. - [x] Android - [x] Mac - [x] iOS - [x] Windows ### Issues Fixed Fixes #36818 ### Output |Before Fix|After Fix| |--|--| <video src="https://github.com/user-attachments/assets/b53cfaa0-40ca-46a1-b8e4-9d968ee013d0"> |<video src="https://github.com/user-attachments/assets/2ac03219-e022-4115-a225-81cb44f487f6">|
…11 (#36932) Description: > [!NOTE] > Are you waiting for the changes in this PR to be merged? > It would be very helpful if you could [test the resulting artifacts](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from this PR and let us know in a comment if this change resolves your issue. Thank you! ### Description of Change CollectionView UI tests on Windows were failing in CI because the visual-regression snapshot baselines no longer matched the current rendered output. This PR updates the snapshot images used by these tests so they reflect the correct expected UI, resolving the CI failures. **Changes:** - Updated baseline snapshot `windows/HeaderAndFooterShouldBeVisible.png` - Updated baseline snapshot `windows/CollectionViewSelectionShouldClear.png` **Issue Fixed** Fixes #36810
…on behavior (#30875) <!-- Please let the below note in for people that find this PR --> > [!NOTE] > Are you waiting for the changes in this PR to be merged? > It would be very helpful if you could [test the resulting artifacts](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from this PR and let us know in a comment if this change resolves your issue. Thank you! ### Description of Change Annotates the remaining .NET MAUI Controls type converters for nullable reference types and updates the seven platform PublicAPI ledgers to match their actual override contracts. The review also uncovered and fixes several converter failure paths: - `StrokeShapeTypeConverter` - Honors the culture supplied to direct `TypeConverter` calls. - Keeps XAML and XamlC numeric parsing invariant and exponent-aware. - Makes XamlC emit a `RoundRectangle` for a numeric radius instead of constructing a `Rectangle` and invoking a `RoundRectangle` setter on it. - `FontAttributesConverter` - Produces comma-separated output that round-trips. - Continues rejecting malformed comma tokens while treating whitespace-only input as `FontAttributes.None`. - `BindablePropertyConverter` - Returns `null` rather than throwing a `NullReferenceException` for unresolved direct-converter type names. - Validates truncated VisualState parent chains and reports `XamlParseException` with the most specific available diagnostic. - Simplifies converter implementations without changing valid-input mappings, including `TextAlignmentConverter`. ### Root Cause Several converters still used nullable-oblivious override signatures. While annotating them, tests exposed assumptions that were hidden by the old implementation: build-time parsing depended on the build host's culture, the compiled numeric `StrokeShape` fallback emitted the wrong shape type, `FontAttributes` used a non-round-trippable separator, and `BindableProperty` resolution indexed parent chains without checking their length. ### Compatibility Notes - Runtime XAML, CSS, and the current SourceGen fallback use invariant conversion. - Direct `TypeConverter.ConvertFrom(context, culture, value)` calls honor the supplied culture. - No public members are added or removed; the PublicAPI updates record nullability annotations for existing overrides. ### What NOT to Do - Do not use the build host's current culture when compiling numeric XAML literals. - Do not skip empty `FontAttributes` tokens; malformed comma-delimited values must remain errors. - Do not enable the optimized SourceGen `StrokeShapeConverter` until its numeric `RoundRectangle` fallback is implemented. ### Validation - `dotnet cake --target=dotnet-build --configuration=Release --verbosity=normal` - 60 focused Controls Core converter tests - 24 focused XAML tests covering Runtime, XamlC, SourceGen fallback, culture isolation, and VisualState parent-chain diagnostics ### Issues Fixed No linked issue. --------- Co-authored-by: Tamilarasan Paranthaman <93904422+Tamilarasan-Paranthaman@users.noreply.github.com> Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: a6db2315-d16d-4f19-94ec-2e5a7cbccda6 Co-authored-by: Jakub Florkowski <42434498+kubaflo@users.noreply.github.com>
Reset patterns: - global.json - NuGet.config - eng/Version.Details.xml - eng/Versions.props - eng/common/*
|
Azure Pipelines: Successfully started running 1 pipeline(s). There may be pipelines that require an authorized user to comment /azp run to run. |
kubaflo
approved these changes
Jul 30, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I detected changes in the net11.0 branch which have not been merged yet to release/11.0.1xx-preview7. I'm a robot and am configured to help you automatically keep release/11.0.1xx-preview7 up to date, so I've opened this PR.
This PR merges commits made on net11.0 by the following committers:
Instructions for merging from UI
This PR will not be auto-merged. When pull request checks pass, complete this PR by creating a merge commit, not a squash or rebase commit.
If this repo does not allow creating merge commits from the GitHub UI, use command line instructions.
Instructions for merging via command line
Run these commands to merge this pull request from the command line.
or if you are using SSH
After PR checks are complete push the branch
Instructions for resolving conflicts
Instructions for updating this pull request
Contributors to this repo have permission update this pull request by pushing to the branch 'merge/net11.0-to-release/11.0.1xx-preview7'. This can be done to resolve conflicts or make other changes to this pull request before it is merged.
The provided examples assume that the remote is named 'origin'. If you have a different remote name, please replace 'origin' with the name of your remote.
or if you are using SSH
Contact .NET Core Engineering (dotnet/dnceng) if you have questions or issues.
Also, if this PR was generated incorrectly, help us fix it. See https://github.com/dotnet/arcade/blob/main/.github/workflows/scripts/inter-branch-merge.ps1.